/*---------------------------------------------------------

  GAMEMODE
  This is based off of GMod's default gamemode. (Sandbox)

---------------------------------------------------------*/


// These files get sent to the client
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "cl_spawnmenu.lua" )
AddCSLuaFile( "cl_notice.lua" )
AddCSLuaFile( "cl_worldtips.lua" )
AddCSLuaFile( "player_extension.lua" )
AddCSLuaFile( "cl_scoreboard.lua" )
AddCSLuaFile( "scoreboard/admin_buttons.lua" )
AddCSLuaFile( "scoreboard/player_frame.lua" )
AddCSLuaFile( "scoreboard/player_row.lua" )
AddCSLuaFile( "scoreboard/scoreboard.lua" )
AddCSLuaFile( "scoreboard/vote_button.lua" )
AddCSLuaFile( "spawnmenu/CreationMenu/manifest.lua" )
AddCSLuaFile( "spawnmenu/CreationMenu/ModelBrowse.lua" )
AddCSLuaFile( "spawnmenu/CreationMenu/Props.lua" )
AddCSLuaFile( "spawnmenu/CreationMenu/Props/PropPanel.lua" )
AddCSLuaFile( "spawnmenu/CreationMenu/Props/PropSearch.lua" )
AddCSLuaFile( "spawnmenu/CreationMenu/Props/SearchGuts.lua" )
AddCSLuaFile( "spawnmenu/controls/control_presets.lua" )
AddCSLuaFile( "spawnmenu/controls/CtrlColor.lua" )
AddCSLuaFile( "spawnmenu/controls/CtrlListBox.lua" )
AddCSLuaFile( "spawnmenu/controls/CtrlNumPad.lua" )
AddCSLuaFile( "spawnmenu/controls/manifest.lua" )
AddCSLuaFile( "spawnmenu/controls/preset_editor.lua" )
AddCSLuaFile( "spawnmenu/controls/RopeMaterial.lua" )
AddCSLuaFile( "spawnmenu/contextmenu.lua")
AddCSLuaFile( "spawnmenu/controlpanel.lua")
AddCSLuaFile( "spawnmenu/CreationMenu.lua")
AddCSLuaFile( "spawnmenu/spawnmenu.lua")
AddCSLuaFile( "spawnmenu/toolmenu.lua")
AddCSLuaFile( "spawnmenu/ToolMenuButton.lua")
AddCSLuaFile( "spawnmenu/toolpanel.lua")


include( 'player.lua' )
include( 'shared.lua' )
include( 'commands.lua' )

/*---------------------------------------------------------
   Name: gamemode:PlayerSpawn( )
   Desc: Called when a player spawns
---------------------------------------------------------*/
function GM:PlayerSpawn( pl )

	self.BaseClass.PlayerSpawn( self, pl )
	
	
end

/*---------------------------------------------------------
   Name: gamemode:OnPhysgunFreeze( weapon, phys, ent, player )
   Desc: The physgun wants to freeze a prop
---------------------------------------------------------*/
function GM:OnPhysgunFreeze( weapon, phys, ent, ply )
	
	self.BaseClass:OnPhysgunFreeze( weapon, phys, ent, ply )

end


/*---------------------------------------------------------
   Name: gamemode:OnPhysgunReload( weapon, player )
   Desc: The physgun wants to freeze a prop
---------------------------------------------------------*/
function GM:OnPhysgunReload( weapon, ply )

	local num = ply:PhysgunUnfreeze()
	
end


/*---------------------------------------------------------
   Called once on the player's first spawn
---------------------------------------------------------*/
function GM:PlayerInitialSpawn( ply )

	self.BaseClass:PlayerInitialSpawn( ply )

end

/*---------------------------------------------------------
   Name: gamemode:PlayerUnfrozeObject( )
---------------------------------------------------------*/
function GM:PlayerUnfrozeObject( ply, entity, physobject )

	local effectdata = EffectData()
		effectdata:SetOrigin( physobject:GetPos() )
	util.Effect( "phys_unfreeze", effectdata, true, true )	
	
end


/*---------------------------------------------------------
   Name: gamemode:PlayerFrozeObject( )
---------------------------------------------------------*/
function GM:PlayerFrozeObject( ply, entity, physobject )

	local effectdata = EffectData()
		effectdata:SetOrigin( physobject:GetPos() )
	util.Effect( "phys_freeze", effectdata, true, true )	
	
end
